﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace CLUBsInterpreter.AST
{
	/**
	 * <summary>
	 * Describes a library reference node in the AST.
	 * </summary>
	 **/
	class LibraryNode : AbstractSyntaxTree
	{
		/**
		 * <summary>
		 * The name of the library to be included.
		 * </summary>
		 **/
		public string Name;

		/**
		 * <see cref="AbstractSyntaxTree.Visit"/>
		 **/
		public override void Visit(Visitor v)
		{
			// Call the appropriate Visitor method
			if (m_visitedOnce)
				v.VisitLibraryNodeSecond(this);
			else
			{
				m_visitedOnce = true;
				v.VisitLibraryNode(this);
			}
		}

		public override void PrintTree(TextWriter outStream, int depth)
		{
			// Print the library node
			outStream.WriteLine(AbstractSyntaxTree.TabDepth(depth) + "LibraryNode");
		}
	}
}
